<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>$Title$</title>
</head>

<body>

<form action="http://localhost:8080/codeyanzheng" method="get">
<tr>
    <td>验证码：</td>
    <td> <input type="text" style="width: 150px" value="" name="code" id="code" class="text"></td>
    <td><img id="codeimg" src="/kaptcha" style="width: 80px;height: 30px;cursor: pointer;" title="看不清？换一张" alt=""></td>
</tr>
    <input type="submit" value="登录">
<div th:if="${msg}!=null"><span th:text="${msg}"></span></div>
</form>

</body>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script>
    $(function () {
        $("#codeimg").click(function () {
            this.src="http://localhost:8080/kaptcha?d="+new Date();
        })
    })

</script>
</html>
